/**
 * Copyright (c) 2011 Nokia Corporation.
 */

#pragma once

#include "SpriteBatch.h"
#include <QObject>
#include <QMatrix4x4>
#include <QPainter>
#include <QPaintDevice>

class QPainterSpriteBatch : public QObject, public SpriteBatch
{
    Q_OBJECT

public:
    QPainterSpriteBatch(int targetWidth, int targetHeight, QPaintDevice *paintDevice, QObject *parent);
    virtual ~QPainterSpriteBatch();

    void draw ( SpriteDrawInfo *sdi, int spriteCount=1 );
    void begin( BlendMode blendMode = eALPHA, TransformMode dTransform = ePIXELSPACE, float *customProjectionMatrix = 0);
    void end();

protected:
    QPaintDevice *device;
    QPainter *painter;
    QMatrix4x4 projectionMatrix;
};


